﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TianShiProject.Models.Common;
using TianShiProject.Models.HumanAffairs.Entrys;
using Volo.Abp.Application.Services;

namespace TianShiProject.HumanAffairs.Entrys
{
    public class EntryService : ApplicationService
    {
        private readonly IEntryRepository _entryRepository;
        public EntryService(IEntryRepository entryRepository)
        {
            _entryRepository = entryRepository;
        }

        #region 入职办理——查询分页显示
        /// <summary>
        /// 入职办理——查询分页显示
        /// </summary>
        /// <param name="EntryName"></param>
        /// <param name="DeptId"></param>
        /// <param name="PositionId"></param>
        /// <param name="EntryTime"></param>
        /// <param name="State"></param>
        /// <param name="pageindex"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public async Task<PageResponse<EntryDto>> GetEntryPageShow(string EntryName, int DeptId, int PositionId, DateTime? EntryTime, int State, int pageindex = 1, int pagesize = 3)
        {
            return await _entryRepository.GetEntryPageShow(EntryName, DeptId, PositionId, EntryTime, State, pageindex, pagesize);
        }
        #endregion

        #region 入职办理——逻辑删除
        /// <summary>
        /// 入职办理——逻辑删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<int> DeleteEntry(int id)
        {

            return await _entryRepository.DeleteEntry(id);
        }
        #endregion

        #region 入职办理——批量删除
        /// <summary>
        /// 入职办理——批量删除
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>
        public async Task<int> DeleteBatchEntry(string ids)
        {
            return await _entryRepository.DeleteBatchEntry(ids);
        }
        #endregion

        #region 入职办理——编辑
        /// <summary>
        /// 入职办理——编辑
        /// </summary>
        /// <param name="entryDto"></param>
        /// <returns></returns>
        public async Task<int> PutUpdateEntry(EntryDto entryDto)
        {
            return await _entryRepository.PutUpdateEntry(entryDto);
        }
        #endregion

        #region 入职办理——添加
        /// <summary>
        /// 入职办理——添加
        /// </summary>
        /// <param name="entryDto"></param>
        /// <returns></returns>
        public async Task<int> PostAddEntry(EntryDto entryDto)
        {
            return await _entryRepository.PostAddEntry(entryDto);
        }
        #endregion
    }
}
